import request from '@/utils/request'

// 查询月度用电诊断分页信息
export const getMonReportListApi = params => request.get('/pio-microservice-biz/pio/month-ele-diagnostic/page', { params })

// 查询年度用电诊断分页信息
export const getYearReportListApi = params => request.get('/pio-microservice-biz/pio/year-ele-diagnostic/page', { params })

// 新增初始化用电诊断信息
export const addReportApi = params => request.get('/pio-microservice-biz/pio/ele-diagnostic/init', { params })

// 初始化新增月度用电诊断报告信息
export const addMonReportApi = params => request.get('/pio-microservice-biz/pio/month-ele-diagnostic/init', { params })

// 初始化新增年度用电诊断报告信息
export const addYearReportApi = params => request.get('/pio-microservice-biz/pio/year-ele-diagnostic/init', { params })

// 删除用电诊断报告
export const delReportApi = id => request.post(`/pio-microservice-biz/pio/ele-diagnostic/delete?id=${id}`)

// 删除月度用电诊断报告
export const delMonReportApi = id => request.post(`/pio-microservice-biz/pio/month-ele-diagnostic/delete?id=${id}`)

// 删除年度用电诊断报告
export const delYearReportApi = id => request.post(`/pio-microservice-biz/pio/year-ele-diagnostic/delete?id=${id}`)

// 保存用电诊断
export const saveReportApi = data => request.post('/pio-microservice-biz/pio/ele-diagnostic/save', data)

// 保存月度用电诊断报告
export const saveMonReportApi = data => request.post('/pio-microservice-biz/pio/month-ele-diagnostic/save', data)

// 保存年度用电诊断报告
export const saveYearReportApi = data => request.post('/pio-microservice-biz/pio/year-ele-diagnostic/save', data)

// 下载月度用电诊断报告
export const downloadMonReportApi = id => request.post(`/pio-microservice-biz/pio/month-ele-diagnostic/download/pdf?id=${id}`)

// 下载年度用电诊断报告
export const downloadYearReportApi = id => request.post(`/pio-microservice-biz/pio/year-ele-diagnostic/download/pdf?id=${id}`)

// 查询月度用电诊断分页信息
export const getReportPageApi = params => request.get('/pio-microservice-biz/pio/ele-diagnostic/page', { params })

// 字典下拉框
export const getSelect = params => request.get('core/dictionary/combo-item/list', { params })

// 导出用电诊断数据
export const exportReportApi = data => request.post('/pio-microservice-biz/pio/ele-diagnostic/excel', data, { responseType: 'arraybuffer' })